{extend name="main"}

{block name="content"}

<div class="think-box-shadow margin-bottom-15">
    <span class="color-green font-w7">文件存储引擎：</span>
    {foreach ['local'=>'本地服务器存储','qiniu'=>'七牛云对象存储','oss'=>'阿里云OSS存储'] as $k=>$v}
    {if sysconf('storage_type') eq $k}
    {if auth('file')}<a data-modal="{:url('file')}?type={$k}" class="layui-btn layui-btn-sm">{$v}</a>{else}<a class="layui-btn layui-btn-sm">{$v}</a>{/if}
    {elseif auth('file')}<a data-modal="{:url('file')}?type={$k}" class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{/if}
    {/foreach}
</div>
<div class="think-box-shadow margin-bottom-15">
    <span class="color-green font-w7">缓存引擎：</span>
    {foreach ['redis'=>'Redis','file'=>'File'] as $k=>$v}
    {if sysconf('cache_type') eq $k}
    {if auth('file')}<a data-modal="{:url('cache')}?type={$k}" class="layui-btn layui-btn-sm">{$v}</a>{else}<a class="layui-btn layui-btn-sm">{$v}</a>{/if}
    {elseif auth('file')}<a data-modal="{:url('cache')}?type={$k}" class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{/if}
    {/foreach}
</div>

<form onsubmit="return false" data-auto="true" action="{:url()}" method="post" class="think-box-shadow padding-40 padding-bottom-10">
    <div class="layui-row layui-col-space30">
        <div class="layui-col-md6 layui-col-lg-offset3">
            <div class="layui-form">
                <label class="relative block">
                    <span class="color-green font-w7">程序名称</span>
                    <span class="color-desc margin-left-5">Name</span>
                    <input name="app_name" required placeholder="请输入程序名称" value="{:sysconf('app_name')}" class="layui-input">
                </label>
            </div>
            <div class="layui-form">
                <label class="relative block">
                    <span class="color-green font-w7">程序版本</span>
                    <span class="color-desc margin-left-5">Version</span>
                    <input name="app_version" placeholder="请输入程序版本" value="{:sysconf('app_version')}" class="layui-input">
                </label>
            </div>
            <div class="layui-form">
                <label class="relative block">
                    <span class="color-green font-w7">网站名称</span>
                    <span class="color-desc margin-left-5">Website</span>
                    <input name="site_name" required placeholder="请输入网站名称" value="{:sysconf('site_name')}" class="layui-input">
                </label>
            </div>
            <div class="layui-form">
                <label class="relative block">
                    <span class="color-green font-w7">关键词</span>
                    <span class="color-desc margin-left-5">Version</span>
                    <input placeholder="描述" name="app_keyword" class="layui-input" value="{:sysconf('app_keyword')}">
                </label>
            </div>
            <div class="layui-form">
                <label class="relative block">
                    <span class="color-green font-w7">描述</span>
                    <span class="color-desc margin-left-5">Version</span>
                    <textarea placeholder="描述" name="app_desc" class="layui-textarea">{:sysconf('app_desc')}</textarea>
                </label>
            </div>
            <div class="layui-form">
                <label class="relative block">
                    <span class="color-green font-w7">CDN前缀</span>
                    <input name="app_cdn" placeholder="http://" value="{:sysconf('app_cdn')}" class="layui-input">
                </label>
            </div>
            <div class="layui-form">
                <label class="relative block">
                    <span class="color-green font-w7">统计代码</span>
                    <textarea name="app_tongji" class="layui-textarea" cols="30" rows="10">{:sysconf('app_tongji')}</textarea>
                </label>
            </div>
        </div>
        <div class="layui-col-md6">
            <div class="layui-form-item">
                <span class="color-green font-w7">浏览器图标</span>
                <span class="color-desc margin-left-5">Browser</span>
                <div class="relative block">
                    <img alt="icon" data-tips-image style="height:auto;max-height:32px;min-width:32px" src="{:sysconf('site_icon')}"/>
                    <input type="hidden" name="site_icon" onchange="$(this).prev('img').attr('src', this.value)" value="{:sysconf('site_icon')}" class="layui-input">
                    <a class="margin-left-10" data-file="btn" data-type="ico,png" data-field="site_icon">上传图片</a>
                    <p class="help-block">建议上传 ICO 图标的尺寸为 128x128
                        <a href="http://www.favicon-icon-generator.com" target="_blank">ICON在线制作</a></p>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="relative block">
                    <span class="color-green font-w7">网站备案号</span>
                    <span class="color-desc margin-left-5">Miitbeian</span>
                    <input name="miitbeian" placeholder="请输入网站备案号" value="{:sysconf('miitbeian')}" class="layui-input">
                </label>
                <p class="help-block">网站备案号，可以在<a target="_blank" href="http://beian.miit.gov.cn">备案管理中心</a>查询获取，将在登录页面下面显示
                </p>
            </div>
            <div class="layui-form-item">
                <label class="relative block">
                    <span class="color-green font-w7">网站版权信息</span>
                    <span class="color-desc margin-left-5">Copyright</span>
                    <input name="site_copy" required placeholder="请输入版权信息" value="{:sysconf('site_copy')}" class="layui-input">
                </label>
                <p class="help-block">网站版权信息，在后台登录页面显示版本信息并链接到备案到信息备案管理系统</p>
            </div>
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="layui-form-item text-center">
        <button class="layui-btn" type="submit">保存配置</button>
    </div>
</form>

{/block}